import java.util.Scanner;

public class G_1_31 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        while (sc.hasNextInt()){
            int num = sc.nextInt();
            int re = 0;
            if(num==0)
                break;
            int[] ar = new int[num];
            for (int i = 0; i < num; i++) {
                ar[i] = sc.nextInt();
            }
            for (int i = 0; i < num; i++) {
                if (ar[i]>=100){
                    while (true){
                        re++;
                        ar[i]-=100;
                        if (ar[i]<100)
                            break;
                    }
                }
                if (ar[i]>=50){
                    while (true){
                        re++;
                        ar[i]-=50;
                        if (ar[i]<50)
                            break;
                    }
                }
                if (ar[i]>=10){
                    while (true){
                        re++;
                        ar[i]-=10;
                        if (ar[i]<10)
                            break;
                    }
                }
                if (ar[i]>=5){
                    while (true){
                        re++;
                        ar[i]-=5;
                        if (ar[i]<5)
                            break;
                    }
                }
                if (ar[i]>=2){
                    while (true){
                        re++;
                        ar[i]-=2;
                        if (ar[i]<2)
                            break;
                    }
                }
                if (ar[i]>=1){
                    while (true){
                        re++;
                        ar[i]-=1;
                        if (ar[i]<1)
                            break;
                    }
                }
            }
            System.out.println(re);
        }
    }
}
